// pages/found/found.js
const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    tie:[
      {tou:'https://6c79-lyr-4gvx88rj047e3d79-1308815870.tcb.qcloud.la/1679377995000.png?sign=a8c3d17f0792e373367d668ea83dfe7e&t=1679378002',name:'老茄子',
      img:'http://cdn.boundary.vip/ceb76122ea566fd87c8d63c1f0e13397.png',txt:'现代人皮肤问题越来越多到底是为什么？'},
    ],
    tie_1:[
      {tou:'https://6c79-lyr-4gvx88rj047e3d79-1308815870.tcb.qcloud.la/1679377824000.png?sign=2d064f6466774210bc95f6b65aa78faa&t=1679377831',name:'艾米',
      img:'https://6c79-lyr-4gvx88rj047e3d79-1308815870.tcb.qcloud.la/1679375020000.png?sign=d2d7e4039403fce8ab27cadc50e07f12&t=1679375030',txt:'油痘肌常选的水乳解析'},
    ],
    ketang:[
      {img:'http://cdn.boundary.vip/ee80a3390ea369cf9310b5768c7a3dbe.jpg',
      txt:'如何缓解冬季皮肤瘙痒',kind:'ke4'},
      {img:'http://cdn.boundary.vip/90e84d7f27f58ff728169d41aaa8ffa6.jpg',
      txt:'眼皮松弛下垂及解决方法',kind:'ke2'},
      {img:'http://cdn.boundary.vip/a7a90c06fbdd5c7aaf2179a4aa9f4abf.jpg',
      txt:'缓解荨麻疹的3种方法',kind:'ke3'},
      {img:'http://cdn.boundary.vip/30080bef909f4d839fa34e3e21b2950f.png',
      txt:'护肤小技巧，常识篇',kind:'ke1'},
    ],
    abc:"-1",
    ABC:"-1",
    ab:"-1",
    AB:"-1",
    shipu:[
      {img:'http://cdn.boundary.vip/4eb68cfd1e3e9b18377ad144798d1c4a.png',
      txt:'轻食沙拉，简单又好吃',kind:'sp1'},
      {img:'http://cdn.boundary.vip/14ab916cf8aa07596fa43db9ee10855f.jpg',
      txt:'广东养生汤，快来学！',kind:'sp2'},
      {img:'http://cdn.boundary.vip/edee3c2b7651202bf03becc50b61123b.png',
      txt:'美味皮蛋瘦肉粥之章',kind:'sp3'},
      {img:'http://cdn.boundary.vip/ba6c277744f7fd2fbc4462f208e0484e.png',txt:'科学指定健康食谱',kind:'sp4'}
      
    ],
    position:''

  },
  sp1(){
    wx.navigateTo({
      url: '/pages/sp1/sp1',
    })
  },
  sp2(){
    wx.navigateTo({
      url: '/pages/sp1/sp2',
    })
  },
  sp3(){
    wx.navigateTo({
      url: '/pages/sp1/sp3',
    })
  },
  sp4(){
    wx.navigateTo({
      url: '/pages/sp1/sp4',
    })
  },
  ke1(){
    wx.navigateTo({
      url: '/pages/ke1/ke1',
    })
  },
  ke2(){
    wx.navigateTo({
      url: '/pages/ke1/ke2',
    })
  },
  ke3(){
    wx.navigateTo({
      url: '/pages/ke1/ke3',
    })
  },
  ke4(){
    wx.navigateTo({
      url: '/pages/ke1/ke4',
    })
  },
  start:function(){
    var that = this
    this.setData({
      ab:this.data.ab*-1
    })
    if(this.data.ab>0){
      app.globalData.starttie = that.data.tie_1
    }else{
      app.globalData.starttie = false
    }
    console.log(app.globalData.starttie)
  },
  start1:function(){
    var that = this
    this.setData({
      AB:this.data.AB*-1
    })
    if(this.data.AB>0){
      app.globalData.starttie_1 = that.data.tie
    }else{
      app.globalData.starttie_1 = false
    }
    console.log(app.globalData.starttie_1)
  },
  tiepage(){
    wx.navigateTo({
      url: '/pages/tiepage/tiepage',
    })
  },
  tiepage_1(){
    wx.navigateTo({
      url: '/pages/tiepage1/tiepage1',
    })
  },

  like:function(){
    var that = this
    this.setData({
     abc : this.data.abc*-1
    })
    if(this.data.abc>0){
      app.globalData.liketie = that.data.tie_1
    }else{
      app.globalData.liketie = false
    }
    console.log(app.globalData.liketie)
  },
  like1:function(){
    var that = this
    this.setData({
     ABC : this.data.ABC*-1
    })
    if(this.data.ABC>0){
      app.globalData.liketie_1 = that.data.tie
    }else{
      app.globalData.liketie_1 = false
    }
    console.log(app.globalData.liketie_1)
  },

  getlocal:function(){
    var that = this;
    wx.chooseLocation({
      success(res){
        console.log(res.address)
        that.setData({
          position:res.address
        })
      }
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})